/*
 * logger.c
 *
 *  Created on: 2011-09-30
 *      Author: byron
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stdint.h>
#include "serial.h"
#include "config.h"

#define LOGGER_BUFFER_SIZE	512

volatile char logger_base[LOGGER_BUFFER_SIZE];

enum logger_dst {mem, uart0, uart2, mmc, nand, udp, tcp};

int lprintf(const char *format, ...)
{
	va_list arg;

	va_start(arg,format);
  vsnprintf((char*)logger_base, LOGGER_BUFFER_SIZE, format, arg);
  va_end(arg);


  return xSerialPutString( DEBUG_UART, (const char*)logger_base, strlen((char*)logger_base) );
}

